package com.bifang.core.dao.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 二维码表历史
 *
 * @author chenzh
 * @since 2020-07-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("APP_CODE_HISTORY")
@ApiModel(value = "AppCodeHistory对象", description = "二维码表历史")
public class AppCodeHistory extends Model<AppCodeHistory> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "CODE_ID", type = IdType.INPUT)
    private Long codeId;

    @ApiModelProperty(value = "开始时间")
    @TableField("BEG_TIME")
    private Date begTime;

    @ApiModelProperty(value = "结束时间")
    @TableField("END_TIME")
    private Date endTime;

    @ApiModelProperty(value = "码编码")
    @TableField("CODE")
    private String code;

    @ApiModelProperty(value = "码属性：1 二维码 2 条形码")
    @TableField("CODE_PRO")
    private String codePro;

    @ApiModelProperty(value = "码类型 20 个人身份码 30企业身份码")
    @TableField("CODE_TYPE")
    private String codeType;

    @ApiModelProperty(value = "码对应唯一id 个人码对应身份证 企业码对应统一社会信用编码")
    @TableField("UNIQUE_ID")
    private String uniqueId;

    @ApiModelProperty(value = "码唯一id对应名称，如姓名或单位名称")
    @TableField("NAME")
    private String name;

    @ApiModelProperty(value = "申请时间 时间搓 到毫秒")
    @TableField("APPLY_TIME")
    private Long applyTime;

    @ApiModelProperty(value = "过期时间 时间搓 到毫秒")
    @TableField("EXPIRE_DATE_TIME")
    private Long expireDateTime;

    @ApiModelProperty(value = "过期时长：0 永久有效 单位秒 默认5分钟")
    @TableField("EXPIRE_TIME")
    private Long expireTime;

    @ApiModelProperty(value = "申请渠道类型 1-App  2-h5 3-微信小程序 4-支付宝小程序 5-钉钉小程序")
    @TableField("APPLY_TYPE")
    private String applyType;

    @ApiModelProperty(value = "app类别 1社交 2金融 3政府 4银行")
    @TableField("APP_TYPE")
    private String appType;

    @ApiModelProperty(value = "app等级 1-国家级 2-省级 3-市级 4-县级")
    @TableField("APP_RATE")
    private String appRate;

    @ApiModelProperty(value = "来源类型 1 本地生成 2省就业创业码")
    @TableField("SOURCE_TYPE")
    private String sourceType;

    @ApiModelProperty(value = "来源对应码")
    @TableField("SOURCE_CODE")
    private String sourceCode;

    @ApiModelProperty(value = "码颜色：绿色 灰色 蓝色 红色")
    @TableField("CODE_COLOR")
    private String codeColor;

    @ApiModelProperty(value = "是否只使用一次 0 否 1 是")
    @TableField("ONCE_FLAG")
    private String onceFlag;

    @ApiModelProperty(value = "是否使用 0 否 1 是")
    @TableField("USAGE_FLAG")
    private String usageFlag;

    @ApiModelProperty(value = "申请用户id")
    @TableField("APPLY_USER_ID")
    private String applyUserId;

    @ApiModelProperty(value = "背景颜色")
    @TableField("BACK_COLOR")
    private String backColor;

    @ApiModelProperty(value = "图片地址")
    @TableField("IMG_PATH")
    private String imgPath;

    @ApiModelProperty(value = "码相关数据 json格式")
    @TableField("CODE_DATA")
    private String codeData;

    @ApiModelProperty(value = "纬度")
    @TableField("LATITUDE")
    private BigDecimal latitude;

    @ApiModelProperty(value = "经度")
    @TableField("LONGITUDE")
    private BigDecimal longitude;

    @ApiModelProperty(value = "申请应用id")
    @TableField("APPLY_CLIENT_ID")
    private String applyClientId;

    @ApiModelProperty(value = "链接地址")
    @TableField("LINK_URL")
    private String linkUrl;

    @ApiModelProperty(value = "链接类型：router 内部路由 h5 第三方H5 weixin 第三方微信小程序")
    @TableField("LINK_TYPE")
    private String linkType;

    @ApiModelProperty(value = "内部路由路径")
    @TableField("LINK_PATH")
    private String linkPath;

    @ApiModelProperty(value = "内部路由名")
    @TableField("LINK_NAME")
    private String linkName;

    @ApiModelProperty(value = "创建人")
    @TableField("CREATE_NAME")
    private String createName;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "CREATE_TIME")
    private Date createTime;

    @ApiModelProperty(value = "修改人")
    @TableField("UPDATE_NAME")
    private String updateName;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "UPDATE_TIME")
    private Date updateTime;

    @ApiModelProperty(value = "逻辑删除标志 0 正常 1 删除")
    @TableField(value = "DEL", fill = FieldFill.INSERT)
    private String del;

    @Override
    public Serializable pkVal() {
        return this.codeId;
    }
}
